﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class header : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        bool isLogin = false;
        if (Session["userinfo"] == null)
            isLogin = false;
        else
            isLogin = true;
        if (isLogin)
        {
            //string[] info = (string[])Session["userinfo"];
            管理员信息表 ad = (管理员信息表)Session["userinfo"];
            this.Label1.Text = ad.username;
            this.Button1.Visible = true;
        }
        else
        {
            this.Label1.Text = "匿名用户";
            this.Button1.Visible = false;
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session.RemoveAll();
        Response.Write("<script language='javascript'>parent.location.href='login.aspx';</script>");
    }
}
